package com.tiger.cmpeb.sample1;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class Client1 {
    public static void main(String args[]) {
        try {
            InitialContext ctx = new InitialContext();
            Object obj = ctx.lookup("comp/env/ejb/CustomerBean01");
            CustomerHome01 customerHome =
                (CustomerHome01)PortableRemoteObject.narrow(
                obj, CustomerHome01.class);
            
            Integer customerID = new Integer(1);
            Customer01 customer = customerHome.create(customerID, "Suzuki Taro", 20);
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }
}
